<?php
class Training extends AppModel {
    public $belongsTo = array(
        'User' => array(
            'className' => 'User',
            'foreignKey' => 'user_id',
            'fields' => array('id', 'username', 'role')
        )
    );
    public $hasMany = array(
        'Testol' => array(
            'className' => 'Testol',
            'foreignKey' => 'training_id',
            'dependent'  =>  true
        )
    );
}
?>